﻿using System.Web.Mvc;

namespace ASPItalia.ModelVirtualCasting.Web.Utils
{
    public class SkinnableViewEngine : WebFormViewEngine
    {
        public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
        {
            if (controllerContext.HttpContext.Request.Browser.IsMobileDevice)
            {
                viewName = "Mobile/" + viewName;
            }

            return base.FindView(controllerContext, viewName, masterName, useCache);
        }

    }
}